package com.qidian.mes.cal.controller;

import com.qidian.mes.cal.service.CalHolidayService;
import com.qidian.mes.pojo.CalHoliday;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@CrossOrigin
@RequestMapping("/holiday")
public class CalHolidayController {
    @Autowired
    CalHolidayService calHolidayService;

    @PostMapping("/save")
    //添加节假日
    public MESResult save(@RequestBody CalHoliday calHoliday) {
        return calHolidayService.save(calHoliday);
    }

    @GetMapping("/list")
    //查询节假日
    public MESResult list() {
        return calHolidayService.list();
    }
}
